# -*- coding : utf-8 -*-
# author : Big Cat
# time : 2021/7/20:22:25
# file : test01_web_login.py
import unittest

from comm.getdatas import readYaml, Data
from pageobjects.loginpage import LoginPage
from ddt import ddt,unpack,data,file_data
from selenium import webdriver

@ddt
class TestLogin(unittest.TestCase):

    @data(*Data(filename='login.yml').datas)
    @unpack
    def test01_login(self,username,passwd):
        self.driver = webdriver.Chrome()
        login_obj = LoginPage(page_name=LoginPage.__name__,driver=self.driver)
        login_obj.login(username,passwd)
        login_obj.sleep(2)